//
//  NovelSiftFirstTableViewCell.m
//  novel
//
//  Created by 高青松 on 2018/8/11.
//  Copyright © 2018年 Tracy. All rights reserved.
//

#import "NovelSiftFirstTableViewCell.h"

@interface NovelSiftFirstTableViewCell()
@property (nonatomic,strong)UILabel *goodBookTips;//好书畅读
@property (nonatomic,strong)UILabel *goodBookDetail;
@property (nonatomic,strong)UILabel *girlHotTips;//女
@property (nonatomic,strong)UILabel *girlHotDetail;
@property (nonatomic,strong)UILabel *boyHotTips;//男
@property (nonatomic,strong)UILabel *boyHotDetail;
@end


@implementation NovelSiftFirstTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addSubview:self.userWelfareButton];
        
        //新手
        [self.userWelfareButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self);
            make.right.equalTo(self);
            make.top.equalTo(self);
            make.height.equalTo(@(100 * kProportionW));
        }];
        
        //好书
        [self addSubview:self.goodBookTips];
        [self addSubview:self.goodBookDetail];
        [self addSubview:self.goodBookButton];
        [self.goodBookTips mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(20 * kProportionW);
            make.top.equalTo(self.userWelfareButton.mas_bottom).offset(10 * kProportionW);
            make.height.equalTo(@(25 * kProportionW));
        }];
        [self.goodBookDetail mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(20 * kProportionW);
            make.top.equalTo(self.goodBookTips.mas_bottom);
            make.height.equalTo(@(25 * kProportionW));
        }];
        
        [self.goodBookButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(30 * kProportionW);
            make.top.equalTo(self.goodBookDetail.mas_bottom).offset(10 * kProportionW);
            make.height.equalTo(@(170 * kProportionW));
            make.width.equalTo(@(kScreenW/2 - 50 * kProportionW));
        }];
        
        //女生
        [self addSubview:self.girlHotTips];
        [self addSubview:self.girlHotDetail];
        [self addSubview:self.girlHotButton];
        [self.girlHotTips mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(10 * kProportionW + kScreenW/2);
            make.top.equalTo(self.goodBookTips);
            make.height.equalTo(@(20 * kProportionW));
        }];
        [self.girlHotDetail mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.girlHotTips);
            make.top.equalTo(self.girlHotTips.mas_bottom);
            make.height.equalTo(@(30 * kProportionW));
        }];
        
        [self.girlHotButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.girlHotTips); make.top.equalTo(self.goodBookDetail.mas_bottom);
            make.height.equalTo(@(65 * kProportionW));
            make.width.equalTo(@(kScreenW/2 - 30 * kProportionW));
        }];
        
        
        //男生
        [self addSubview:self.boyHotTips];
        [self addSubview:self.boyHotDetail];
        [self addSubview:self.boyHotButton];
        [self.boyHotTips mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.girlHotTips); make.top.equalTo(self.girlHotButton.mas_bottom).offset(10 * kProportionW);
            make.height.equalTo(@(20 * kProportionW));
        }];
        [self.boyHotDetail mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.boyHotTips);
            make.top.equalTo(self.boyHotTips.mas_bottom);
            make.height.equalTo(@(30 * kProportionW));
        }];
        
        [self.boyHotButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.boyHotTips);
            make.top.equalTo(self.boyHotDetail.mas_bottom);
            make.height.equalTo(@(65 * kProportionW));
            make.width.equalTo(@(kScreenW/2 - 30 * kProportionW));
        }];
        
    }
    return self;
}

#pragma mark --set and get--



- (UIButton *)userWelfareButton
{
    if (!_userWelfareButton ) {
        _userWelfareButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _userWelfareButton.backgroundColor = [UIColor whiteColor];
        _userWelfareButton.adjustsImageWhenHighlighted = NO;
    }
    return _userWelfareButton;
}


- (UIButton *)goodBookButton
{
    if (!_goodBookButton) {
        _goodBookButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _goodBookButton.backgroundColor = [UIColor whiteColor];
        _goodBookButton.adjustsImageWhenHighlighted = NO;

    }
    return _goodBookButton;
}
- (UIButton *)girlHotButton
{
    if (!_girlHotButton) {
        _girlHotButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _girlHotButton.backgroundColor = [UIColor whiteColor];
        _girlHotButton.adjustsImageWhenHighlighted = NO;

    }
    return _girlHotButton;
}

- (UIButton *)boyHotButton
{
    if (!_boyHotButton) {
        _boyHotButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _boyHotButton.backgroundColor = [UIColor whiteColor];
        _boyHotButton.adjustsImageWhenHighlighted = NO;

    }
    return _boyHotButton;
}

//男生
- (UILabel *)boyHotTips
{
    if (!_boyHotTips) {
        _boyHotTips = [[UILabel alloc]init];
        _boyHotTips.text = @"男生畅销榜";
        _boyHotTips.textColor = [UIColor blackColor];
        _boyHotTips.font = [UIFont boldSystemFontOfSize:16 * kProportionW];
        _boyHotTips.textAlignment = NSTextAlignmentLeft;
    }
    return _boyHotTips;
}

- (UILabel *)boyHotDetail
{
    if (!_boyHotDetail) {
        _boyHotDetail = [[UILabel alloc]init];
        _boyHotDetail.text = @"最新热卖作品";
        _boyHotDetail.font = [UIFont systemFontOfSize:13 * kProportionW];
        _boyHotDetail.textColor = TINTCOLOR;
        _boyHotDetail.textAlignment = NSTextAlignmentLeft;
    }
    return _boyHotDetail;
}


//女生
- (UILabel *)girlHotTips
{
    if (!_girlHotTips) {
        _girlHotTips = [[UILabel alloc]init];
        _girlHotTips.text = @"女生完结好书";
        _girlHotTips.textColor = [UIColor blackColor];
        _girlHotTips.font = [UIFont boldSystemFontOfSize:16 * kProportionW];
        _girlHotTips.textAlignment = NSTextAlignmentLeft;
    }
    return _girlHotTips;
}

- (UILabel *)girlHotDetail
{
    if (!_girlHotDetail) {
        _girlHotDetail = [[UILabel alloc]init];
        _girlHotDetail.text = @"任性不追更，每本都是精选...";
        _girlHotDetail.font = [UIFont systemFontOfSize:13 * kProportionW];
        _girlHotDetail.textColor = TINTCOLOR;
        _girlHotDetail.textAlignment = NSTextAlignmentLeft;
    }
    return _girlHotDetail;
}


//好书
- (UILabel *)goodBookTips
{
    if (!_goodBookTips) {
        _goodBookTips = [[UILabel alloc]init];
        _goodBookTips.text = @"好书畅读";
        _goodBookTips.textColor = [UIColor blackColor];
        _goodBookTips.font = [UIFont boldSystemFontOfSize:16 * kProportionW];
        _goodBookTips.textAlignment = NSTextAlignmentLeft;
    }
    return _goodBookTips;
}

- (UILabel *)goodBookDetail
{
    if (!_goodBookDetail) {
        _goodBookDetail = [[UILabel alloc]init];
        _goodBookDetail.text = @"舍不得读完系列";
        _goodBookDetail.font = [UIFont systemFontOfSize:13 * kProportionW];
        _goodBookDetail.textColor = TINTCOLOR;
        _goodBookDetail.textAlignment = NSTextAlignmentLeft;
    }
    return _goodBookDetail;
}

@end
